# coding: utf-8

import mysql.connector

# 修正 database 拼写错误
conn = mysql.connector.connect(host='127.0.0.1',port=3306,user='root', password='root', database='dfq')
cursor = conn.cursor()

print("--------------连接上-------------------")

cursor.execute("insert into upload(name,code,size,type,save_address,add_time,deleted_id) values('dfq','123456','123','123','123','2025-05-17 15:32:47','123')")
print(cursor.rowcount) #返回执行的受影响的行数
conn.commit()

print("--------------插入成功-------------------")

cursor.execute("select * from upload")
print(cursor.fetchall())   #返回查询的结果集,结果集市一个list 吗，诶个

cursor.close()
conn.close()
